{% extends "base.html" %}
{% block content %}
<h2 class="forum-link"><a href="/forum/{{topic.forum.id}}">Nazaj na {{topic.forum.name}}</a></h2>
	<h1>{{topic.title}}</h1>
	<div class="topic-first">{{topic.content}}</div>
	<h3 class="head">{{topic.author}} @ {{topic.date_modified}}</h3>
	
    <ul class="posts">
        {% for post in posts%}
	    <li class="post"> 
	        <div>{{post.content}}</div>
	        <h3 class="head">{{post.author}} @ {{post.date_modified}}</h3>
	    </li>
	    {% endfor %}
        {% if preview %}
            <li class="post"> 
                <h2>PREDOGLED</h2>
            
                <div>{{content}}</div>
                <h3 class="head">{{user}} @ zdaj</h3>
            </li>
        {% endif %}
	</ul>
	{% if user.is_authenticated %}
        <form action="" method="post">
    				<h2>Odgovori</h2>
    				<div id="quicktags">
    					
    					<script src="/static/javascript/quicktags.js" type="text/javascript"></script>
    					<script type="text/javascript">edToolbar();</script><div id="ed_toolbar"><input id="ed_strong" accesskey="b" class="ed_button" onclick="edInsertTag(edCanvas, 0);" value="b" type="button"><input id="ed_link" accesskey="url" class="ed_button" onclick="edInsertLink(edCanvas, 1);" value="link" type="button"><input id="ed_em" accesskey="i" class="ed_button" onclick="edInsertTag(edCanvas, 2);" value="i" type="button"><input id="ed_block" accesskey="q" class="ed_button" onclick="edInsertTag(edCanvas, 3);" value="citat" type="button"><input id="ed_pre" accesskey="c" class="ed_button" onclick="edInsertTag(edCanvas, 4);" value="koda" type="button"></div>
    
    				</div>
    				<textarea rows="15" cols="50" name="content" id="content">{{content}}</textarea>
    				<script type="text/javascript">
    					<!--
    					edCanvas = document.getElementById('content');
    					//-->
    					</script>
    
    				<br> <br>
    				<input name="submit" value="Pošlji" type="submit"> 
    				<input class="preview" value="Predogled" name="preview" type="submit">
    
    	</form>
    {% endif %}
	<br>
<h2 class="forum-link"><a href="/forum/{{topic.forum.id}}">Nazaj na {{topic.forum.name}}</a></h2>
	<br>
{% endblock %}
